package com.insurance.modules.claim.controller;

import com.insurance.common.utils.PageUtils;
import com.insurance.common.utils.R;
import com.insurance.modules.claim.entity.SettlementFileEntity;
import com.insurance.modules.claim.service.SettlementFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 理赔文件表
 *
 * @author weiruifeng
 * @email
 * @date 2021-09-24 17:42:47
 */
@RestController
@RequestMapping("claim/settlementfile")
@Api(tags = "理赔文件")
public class SettlementFileController {
    @Autowired
    private SettlementFileService settlementFileService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("claim:settlementfile:list")
    @ApiOperation(value = "查询列表", notes = "根据条件查询列表")
    public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = settlementFileService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("claim:settlementfile:info")
    @ApiOperation(value = "查询信息", notes = "根据id查询信息")
    public R info(@PathVariable("id") String id) {
        SettlementFileEntity settlementFile = settlementFileService.getById(id);

        return R.ok().put("settlementFile", settlementFile);
    }


}
